package com.nbsaas.boot.marketing.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "用户积分", model = "用户积分")
@Entity
@Table(name = "bs_user_points")
@Comment("用户积分表")
public class UserPoints extends AbstractEntity {

    @Comment("用户ID")
    @SearchItem(name = "userId", key = "userId", label = "用户ID")
    @FormField(title = "用户ID", sortNum = "1", grid = true, required = true)
    @Column(nullable = false)
    private Long userId;

    @Comment("积分余额")
    @FormField(title = "积分余额", sortNum = "2", grid = true, type = InputType.el_input_number, sort = true)
    private Integer points;

    @Comment("累计获得积分")
    @FormField(title = "累计获得积分", sortNum = "3", grid = true, type = InputType.el_input_number)
    private Integer totalEarned;

    @Comment("累计消费积分")
    @FormField(title = "累计消费积分", sortNum = "4", grid = true, type = InputType.el_input_number)
    private Integer totalSpent;
} 